﻿var feeds_inter;

function PageInit(){
	sidebarL_width = $("#sidebarL").height();
	content_width = $("#content").height();
	
	Nifty("div#menu","small top");
	Nifty("#menu a","small transparent top");
	
	Nifty("div#flashcontent_outside","top bottom");
	
	Nifty("div#search","top");
	Nifty("div#Syn","top bottom");
	
	Nifty("div#PageRank","small bottom");
	Nifty("div#refer_info","tl bottom");

	Nifty("li.ComListLi,div.Form","");
	Nifty("div.ListContent","small");
	Nifty("div#content","bl");
	
	Nifty("div#sidebarL,div#sidebarR,div#content","same-height none");

}

function feeds_slideUp(){
	//$("#feeds").slideUp();
	
  $("#feeds").animate({
      height: 'hide',
      opacity: 'hide'
  }, 'slow');
	
	clearInterval(feeds_inter); 
}

$(document).ready(function(){
	PageInit();
	$("#sidebarR").animate
	  (
	 	{right: "-1px"}, 500, function()
			{
				$("#sidebarL").animate
				  (
						{right: "105px",opacity: 'show'}, 500
				  );
			}
	  );	




	$("[name='custom_cartoon']").click(function(e){
		$("#sidebarL").animate
		  (
			{right: "-220px"}, 500, function()
				{
					$("#sidebarR").animate
					  (
						{right: "-220px"}, 500, function()
							{
								window.location=e.target;
							}
					  );
				}
		  );
	return false;
	});
					  
				  
	$("#Syn").hover(
		function() {
			clearInterval(feeds_inter);
			if($("#feeds").is(":visible")==false){
				//$("#feeds").slideDown('slow');
				//$("#feeds").fadeIn("slow");
				
        $("#feeds").animate({
            height: 'show',
            opacity: 'show'
        }, 'slow');

			};
		}, 
		function() {
			if($("#feeds").is(":visible")){
				feeds_inter=setInterval(feeds_slideUp,3000);
			};
		}
	 );
		
}); 
